Q: When I open a file that comes from our translator with NURBS PATCH, the model is drawn
in scrap3d but not in Spin, SpinLinked, or Enzo, and not in my own application, where I implemented the QuickDraw 3D rendering.
Why is this happening?
A: The reason the model doesn't draw with some of the applications that you mention is that the camera
information written to the file is not useable with those applications. To avoid this problem, comment out the camera information,
as shown here:
preceeding lines omitted
# viewangleaspectcamera4:
# Container (
# ViewAngleAspectCamera ( 0.5235988 1.428571 )
# CameraPlacement (
# 85.06377 -126.2345 189.3926 # location
# 85.06377 37.99321 25.16492 # point of interest
# 0 0 1 # up vector
# )
# CameraRange ( 0.01 150000 )
# CameraViewPort ( -1 1 2 2 )
# )
lightgroup5:
LightGroup ( )
following lines omitted
|
This allows the object to draw properly. What is actually happening is that the object is being drawn, but it's not in the field of view
for the camera. Both Tumbler and Spin attempt to a best-guess approximation for useable camera settings if these settings are not supplied.
This is what Spin used for the camera values:
viewangleaspectcamera4:
Container (
ViewAngleAspectCamera ( 0.03389506 1.428571 )
CameraPlacement (
0 0 30 # location
0 0 0 # point of interest
0 1 0 # up vector
)
CameraRange ( 29.5 30.5 )
CameraViewPort ( -1 1 2 2 )
)
|
If you use something like Spin or Tumbler (which always tries to generate a good view of the data if no camera information is supplied), first get
the camera object from the view with some debugging code. Next, get the camera data from the object, and inspect the values that are generated. Then,
work your way back to determine why the original values in the camera object differ, and try to adjust them to produce something reasonable. You can
also read in the file, determine what values are assigned, write it back out as a text metafile, and investigate the values assigned.
|